package com.ruoyi.system.domain;

import java.math.BigDecimal;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 间接费用对象 indirect
 * 
 * @author ruoyi
 * @date 2024-04-04
 */
@EqualsAndHashCode(callSuper = true)
@Data
@ToString
public class Indirect extends BaseEntity
{

    private static final long serialVersionUID = 1L;

    @ExcelIgnore
    private Long id;

    @ExcelProperty(value = "序号")
    @ColumnWidth(8)
    private Long no;

    @Excel(name = "费用明细")
    @ExcelProperty(value = "费用明细")
    @ColumnWidth(15)
    private String indirectName;

    /** 项目名称 */
    @ExcelIgnore
    private String projectName;

    /** 项目编号 */
    @Excel(name = "项目编号")
    @ExcelProperty(value = "项目编号")
    @ColumnWidth(15)
    private String projectCode;

    /** 间接明细id */
    //@Excel(name = "间接明细id")
    @ExcelIgnore
    private Integer nameId;

    /** 账面工程施工借方发生额合计（不含税） */
    @Excel(name = "账面工程施工借方发生额合计（不含税）")
    @ExcelProperty(value = "账面工程施工借方发生额合计（不含税）")
    @ColumnWidth(20)
    private BigDecimal totalNoTax;

    /** 已收账款 */
    @Excel(name = "已收账款")
    @ExcelProperty(value = "已收账款")
    @ColumnWidth(20)
    private BigDecimal received;

    /** 实际已发生的成本 */
    @Excel(name = "实际已发生的成本")
    @ExcelProperty(value = "实际已发生的成本")
    @ColumnWidth(20)
    private BigDecimal realTotalWithTax;

    /** 预计总成本 */
    @Excel(name = "预计总成本")
    @ExcelProperty(value = "预计总成本")
    @ColumnWidth(20)
    private BigDecimal contractWithTax;

    /** 备注 */
    @ExcelProperty(value = "备注")
    @ColumnWidth(20)
    private String remark;


    public void setNameId(Integer nameId) {
        this.nameId = nameId;
        setIndirectName();
    }

    public void setIndirectName(){
        switch (nameId){
            case 1:
                indirectName = "财务费用";
                break;
            case 2:
                indirectName = "人工费";
                break;
            case 3:
                indirectName = "业务招待费";
                break;
            case 4:
                indirectName = "其它费用";
                break;
            case 5:
                indirectName = "办公费";
                break;
            case 6:
                indirectName = "安全文明措施费";
                break;
            case 7:
                indirectName = "低值易耗品摊销";
                break;
            default:
                indirectName = "未定义费用";
                break;
        }
    }

}
